﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplicationUtility
{
    public partial class Times : Form
    {
        public Times()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txtTimeFromSeconds.Text))
            {
                TimeSpan Ts = TimeSpan.FromSeconds(Convert.ToDouble(txtTimeFromSeconds.Text));
                txtResult.Text = Ts.Hours.ToString() + ":" + Ts.Minutes.ToString() + ":" + Ts.Seconds.ToString();
            }

            if (!String.IsNullOrEmpty(txtTicks.Text))
            {
                TimeSpan Ts = TimeSpan.FromTicks(Convert.ToInt64(txtTicks.Text));
                txtResult.Text = Ts.Hours.ToString() + ":" + Ts.Minutes.ToString() + ":" + Ts.Seconds.ToString();
            }
        }
    }
}
